var imgArr = ["url(img027.jpg)", "url(img028.jpg)", "url(img029.jpg)", "url(img030.jpg)", "url(img031.jpg)", "url(img032.jpg)", "url(img033.jpg)"];
var randomBgIndex = Math.floor(Math.random() * 7);
document.querySelector('body').style.backgroundImage = imgArr[randomBgIndex];
document.querySelector('input').addEventListener('focus', function() {
    document.querySelector('div').style.opacity = "0.5";
})
document.querySelector('div').addEventListener('click', function() {
    document.querySelector('div').style.opacity = "0";
})

document.querySelector('button').addEventListener('click', function() {
    window.open("https://www.baidu.com/s?wd=" + document.querySelector('input').value);
    document.querySelector('div').style.opacity = "0";
})
document.onkeydown = function(event) {
    if (event.keyCode == 13) {
        window.open("https://www.baidu.com/s?wd=" + document.querySelector('input').value);
        document.querySelector('div').style.opacity = "0";
    }
}
